

public class Learn20 {
    public static int findSingleDog(int[] array){
     int ret = 0;
        for (int i = 0; i < array.length; i++) {
            ret ^= array[i];       //又忘了，多看几遍
        }
        return ret;
    }

    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,1,2,3,4};
        int ret = findSingleDog(array);       //找 单身狗1
        System.out.println(ret);
    }
}
